﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Model.ViewModels.ApartmentCrudAdminVm>" %>
<%@ Import Namespace="Web.Helpers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Stanovi
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Novi stan</h2>
    
    <% Html.EnableClientValidation(); %>

    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Forma za unos podataka</legend>
            
            <div class="editor-label">
                <%: Html.Label("Kod") %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Code) %>
                <%: Html.ValidationMessageFor(model => model.Code) %>
            </div>
            
            <div class="editor-label">
                 <%: Html.Label("Zgrada") %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Building) %>
                <%: Html.ValidationMessageFor(model => model.Building) %>
            </div>
            
            <div class="editor-label">
                 <%: Html.Label("Kat") %>
            </div>
            <div class="editor-field">
                <%: Html.EnumDropDownListFor(model => model.Floor, "-- odaberite kat --", new {} )%>
                <%: Html.ValidationMessageFor(model => model.Floor) %>
            </div>
            
            <div class="editor-label">
                <%: Html.Label("Broj soba") %>
            </div>
            <div class="editor-field">
                <%: Html.EnumDropDownListFor(model => model.NumOfRooms, "-- odaberite broj soba --", new {} )%>
                <%: Html.ValidationMessageFor(model => model.NumOfRooms) %>
            </div>

            <div class="editor-label">
                <%: Html.Label("Pročelje") %>
            </div>
            <div class="editor-field">
                <%: Html.EnumDropDownListFor(model => model.Facade, "-- odaberite pročelje --", new {} )%>
                <%: Html.ValidationMessageFor(model => model.Facade) %>
            </div>
            
            <div class="editor-label">
                <%: Html.Label("Model") %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.ApartmentModel) %>
                <%: Html.ValidationMessageFor(model => model.ApartmentModel) %>
            </div>
            
            <div class="editor-label">
                 <%: Html.Label("Cijena") %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Price) %>
                <%: Html.ValidationMessageFor(model => model.Price) %>
            </div>
            
            <div class="editor-label">
                 <%: Html.Label("Površina") %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Area) %>
                <%: Html.ValidationMessageFor(model => model.Area) %>                
            </div>

            <div class="editor-label">
                 <%: Html.Label("Dvoetažan") %>
            </div>
            <div class="editor-field">
                <%: Html.CheckBoxFor(model => model.HasTwoFloors) %>                        
            </div>
            
            <p>
                <input type="submit" value="Spremi stan" />
            </p>
        </fieldset>

    <% } %>    

    <div>
        <%: Html.ActionLink("Povratak na pregled stanova", "Index") %>
    </div>

</asp:Content>

